package br.ufla.pgcc.oomeasures;

import java.util.ArrayList;
import java.util.List;

import br.ufla.pgcc.oomeasures.measures.Measure;

public class ItemMeasured {
	private String name;
	private ItemMeasured parent;
	private List<ItemMeasured> children;
	private double value;
	private Measure measure;
	
	public ItemMeasured(String name, ItemMeasured parent) {
		this.name     = name;
		this.parent   = parent;
		this.children = new ArrayList<ItemMeasured>();
		this.value    = 0d;
	}

	public String getName(){
		return name;
	}
	
	public ItemMeasured getParent(){
		return parent;
	}
	
	public void setParent(ItemMeasured item){
		parent = item;
	}
	
	public List<ItemMeasured> getChildren(){
		return children;
	}
	
	public void addChild(ItemMeasured item){
		children.add(item);
	}
	
	public double getValue(){
		return value;
	}
	
	public void setValue(double value){
		this.value = value;
	}
	
	public void addValue(double value){
		this.value += value;
	}
	
	public Measure getMeasure() {
		return measure;
	}

	public void setMeasure(Measure measure) {
		this.measure = measure;
	}

	public String toString() {
		return name;
	}

}
